﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace feixiangCMS.Controllers
{
    public class HomeController : BaseControl
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            //DavidDB.ADO.DBManager db = new DavidDB.ADO.DBManager();

            //ViewModel.HomeIndex index = new ViewModel.HomeIndex();

            //ICMS.ISiteInfo siteInfoService = new CMSService.SiteInfoService(db);
            //var info = siteInfoService.GetSiteInfo();
            //index.siteInfo = info;

            //ICMS.IColumn columnService = new CMSService.ColumnService(db);
            //var columns = columnService.GetAllColumns();
            //index.columns = columns;

            //index.currentCategory = "Home";

            ////      List<CMSModel.Doc> newDocs = new List<CMSModel.Doc>();
            //ICMS.IDoc docService = new CMSService.DocService(db);
            //var newDocs = docService.GetNewDocList(index.currentCategory);
            //index.newDocs = newDocs;

            //return View(index);

            CMSModel.Doc doc = new CMSModel.Doc();
            doc.CategoryId = 1;
            doc.Content = "bb";
            new CMSService.DocService(db).Insert(doc);
            doc = new CMSService.DocService(db).GetModel(1);

            //  int i = Convert.ToInt32("aaa");

            //doc = new CMSModel.Doc();
            //doc.CategoryId = 100;
            //doc.Content = "cc";
            //new CMSService.DocService(db).Insert(doc);

            db.Commit();
            db.Dispose();
            return View();
        }

    }
}
